package photobox.account

import photobox.photo.Photo

/**
 * 用户浏览记录
 */
class UserBrowse {
    Photo   photo
    Integer  laud       //是否点赞
    static final int laud_NO = 0     //不同意
    static final int laud_YES = 1   //同意

    Date    dateCreated   //创建时间 == 阅读时间
    Date    lastUpdated   //更新时间 == 点赞时间

    static belongsTo = [user:User]
    static constraints = {
        user  unique: ['photo']  //用户和图片联合唯一,只在用户第一次看这张图片时记录
        laud  inList: [laud_NO, laud_YES]
    }

    static mapping = {
        table 'acc_user_browse'
    }
}
